{% extends "base.html" %}

{% block content %}
<h2>Studenci</h2>
<!-- TODO: zdecydować(zapytać), które pola są ważne dla opiekuna praktyk -->
<!-- TODO: siakieś ładne kolorki dla etykiet kierunków -->
{% for spec in specializations %}
<table>
    <thead>
    <tr><th>Kierunek</th><th colspan=7><a href="/students/list/">{{ spec }}</a></th></tr>
    <tr>
        <th>Nazwisko</th>
        <th>Imię</th>
        <!--<th>e-mail</th>-->
        <th>Nr Indeksu</th>
        <th>Rok studiów</th>
        <th>Obco-<br>krajowiec</th>
        <th></th>
        <th></th>
        <th></th>
    </tr>
    </thead>
    {% for student in spec.active_students %}
    <tr>
        <td>{{ student.user.last_name }}</td>
        <td>{{ student.user.first_name }}</td>
        <!--<td>{{ student.user.email }}</td>-->
        <td>{{ student.book_no }}</td>
        <td>{{ student.year_of_study }}</td>
        <td>{% if student.is_foreigner %} tak {% else %} nie {% endif %}</td>
        <td><a href="/students/show/{{ student.id }}/">Pokaż</a></td>
        <td><a href="/students/edit/{{ student.id }}/">Edytuj</a></td>
        <td><a href="/trainings/new/{{ student.id }}/">Nowa praktyka</a></td>
        <!--<td><a href="/students/delete/{{ student.id }}/">Usuń</a></td>-->
    </tr>
    {% endfor %}
    <thead><tr><th>Niezarejestrowani z kierunku</th><th colspan=7><a href="/students/list/{{ spec.id }}/">{{ spec }}</a></th></tr></thead>
    {% for student in spec.unregistered_students %}
    <tr>
        <td>{{ student.user.last_name }}</td>
        <td>{{ student.user.first_name }}</td>
        <!--<td>{{ student.user.email }}</td>-->
        <td>{{ student.book_no }}</td>
        <td>{{ student.year_of_study }}</td>
        <td>{% if student.is_foreigner %} tak {% else %} nie {% endif %}</td>
        <td><a href="/students/show/{{ student.id }}/">Pokaż</a></td>
        <td><a href="/students/edit/{{ student.id }}/">Edytuj</a></td>
        <td />
    </tr>
    {% endfor %}
    <thead><tr><th colspan=10><a href="/students/new/">Nowy student</a></th></tr></thead>
</table>
{% endfor %}
{% endblock %}

